import { App } from 'vue'
import { registerElementPlusComponents } from './register-element'
import { ResponseCode } from './response-code'
import * as Icons from '@element-plus/icons-vue'

function registerApp(app: App): void {
  registerElementPlusComponents(app)

  // 遍历注册图标
  // for (const name in Icons) {
  //   app.component(name, (Icons as any)[name])
  // }

  Object.keys(Icons).forEach((key) => {
    app.component(key, (Icons as any)[key])
  })
}

export { registerApp, ResponseCode }
